using System.Collections.Generic;
using System.Linq;

namespace Spaanjaars.ContactManager.Infrastructure.Domain
{
    public interface IRepository<T, TId>
    {
        T FindBy(TId id);

        int Count();

        IEnumerable<T> FindAll();

        IEnumerable<T> FindAll(int index, int count);

        IEnumerable<T> QueryWith(ISpecification<T> specification);

        IEnumerable<T> QueryWith(ISpecification<T> specification, int index, int count);
       
        void Save(T entity);
        void Add(T entity);
        void Remove(T entity);        
    }
}